﻿<%@ Page Title="" Language="C#" MasterPageFile="~/SkillifyMaster.master" AutoEventWireup="true" CodeFile="ManageTest.aspx.cs" Inherits="ManageTest" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <table class="style1">
        <tr>
            <td colspan="2" align="right">
               <h2> <asp:Label ID="lablManageTest" runat="server" Text="Manage Test"></asp:Label></h2>
            </td>
        </tr>
        <tr>
            <td>
                <table align="left" cellspacing="5" style="border: 4px outset orange;" width="100%">
                   <tr>
                        <td>
                            <asp:Button ID="btnNext" runat="server" PostBackUrl="~/Admin/CreateTestPageOne.aspx" 
                                Text="Create Test" BackColor="#E49642" BorderColor="#CC7A24" 
                                ForeColor="White" CausesValidation="False" />
                        </td>
                    </tr> 

                   <td>
                                <asp:Label ID="lablSubj" runat="server" Text="Subject"></asp:Label> &nbsp;&nbsp;
                                 <asp:DropDownList ID="ddlSub" runat="server" AutoPostBack="True" 
                                    Width="220px" OnSelectedIndexChanged="ddlSub_SelectedIndexChanged">
                                </asp:DropDownList>

                                &nbsp;
                                <asp:CompareValidator ID="compSub" runat="server" ControlToValidate="ddlSub" 
                                    ErrorMessage="Please Select One subject" ForeColor="Red" Operator="NotEqual" 
                                    ValueToCompare="--Select One--">*</asp:CompareValidator>

                                &nbsp;&nbsp;&nbsp;&nbsp;
                                <asp:Label ID="lablTopics" runat="server" Text="Topic"></asp:Label>&nbsp;&nbsp;
                                <asp:DropDownList ID="ddlTopic" runat="server" Width="220px" 
                                    onselectedindexchanged="ddlTopic_SelectedIndexChanged">
                                </asp:DropDownList>
                                &nbsp;&nbsp;&nbsp;&nbsp;
                                 <asp:Button ID="btnShow" runat="server" Text="Show Test" 
                                onclick="btnShow_Click" BackColor="#E49642" 
                                BorderColor="#CC7A24" ForeColor="White" />
                                &nbsp;&nbsp;&nbsp;&nbsp;
                                 <asp:Button ID="ClearRecord" runat="server" Text="Clear search" 
                                CausesValidation="False" BackColor="#E49642" 
                                BorderColor="#CC7A24" ForeColor="White" onclick="ClearRecord_Click" />
                        </td>

                   <tr>
                        
                        <td>
                                <asp:Label ID="lablError" runat="server" ForeColor="Red"></asp:Label>
                                <asp:ValidationSummary ID="valSummSub" runat="server" ForeColor="Red" />
                        </td>
                       
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td>
            <table align="left" width="100%">
                    <tr>
                        <td align="left" valign="top">
                            <asp:GridView ID="gvTest" runat="server" AllowPaging="True" AutoGenerateColumns="False" 
                    onpageindexchanging="gvTest_PageIndexChanging" BackColor="LightGoldenrodYellow" 
                                BorderColor="Tan" BorderWidth="1px" 
            CellPadding="2" ForeColor="Black" GridLines="Vertical" DataKeyNames="TestId,States" 
                                onselectedindexchanged="gvTest_SelectedIndexChanged" 
                                onrowcommand="gvTest_RowCommand" Width="930px">
            <AlternatingRowStyle BackColor="PaleGoldenrod" HorizontalAlign="Center" />
                    <Columns>
                            <asp:ButtonField ButtonType="Link" CommandName="Select" 
                                DataTextField="TestId" HeaderText="Id" SortExpression="TestId" 
                                ItemStyle-Font-Underline="true" >
<ItemStyle  Font-Underline="True"></ItemStyle>
                            </asp:ButtonField>
                            <asp:BoundField DataField="TestName" HeaderText="Name" 
                                SortExpression="TestName" />
                            <asp:BoundField DataField="SubjectName" HeaderText="Subject" 
                                SortExpression="SubjectName" />
                            <asp:BoundField DataField="Topics" HeaderText="Topics" 
                                SortExpression="Topics" >
                            </asp:BoundField>
                            <%--<asp:BoundField DataField="IsQuestionManualSelection" HeaderText="IsManual" 
                                SortExpression="IsQuestionManualSelection" />--%>
                            <asp:BoundField DataField="NoOfQuestion" HeaderText="NoOfQuestion" 
                                SortExpression="NoOfQuestion" />
                            <%--<asp:BoundField DataField="NoOfHighQuestion" HeaderText="NoOfHigh" 
                                SortExpression="NoOfHighQuestion" />
                            <asp:BoundField DataField="NoOfMediumQuestion" HeaderText="NoOfMedium" 
                                SortExpression="NoOfMediumQuestion" />
                            <asp:BoundField DataField="NoOfLowQuestion" HeaderText="NoOfLow" 
                                SortExpression="NoOfLowQuestion" />--%>
                            <asp:BoundField DataField="CutOffMarks" HeaderText="CuttOff" 
                                SortExpression="CutOffMarks" />
                            <%--<asp:BoundField DataField="TestCreatedDate" HeaderText="TestCreatedDate" 
                                SortExpression="TestCreatedDate" />--%>
                            <asp:BoundField DataField="StartDate" HeaderText="StartDate" 
                                SortExpression="StartDate" />
                            <asp:BoundField DataField="EndDate" HeaderText="EndDate" 
                                SortExpression="EndDate" />
                            <%--<asp:BoundField DataField="NoOfAttempts" HeaderText="NoOfAttempts" 
                                SortExpression="NoOfAttempts" />--%>
                            <asp:BoundField DataField="States" HeaderText="Status" 
                                SortExpression="Status" />
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    <asp:Label ID="lablManage" runat="server" Text="Action"></asp:Label>
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:LinkButton ID="linkViewTest" runat="server" Font-Underline="true" CommandName="btnLinkClick" CommandArgument='<%# Eval("TestId") %>'>Manage</asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    <asp:Label ID="lablRank" runat="server" Text="Student Rank"></asp:Label>
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:LinkButton ID="linkRank" runat="server" Font-Underline="true" CommandName="btnLinkRankClick" CommandArgument='<%# Eval("TestId") %>'>Rank</asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <asp:Button ID="btnCopy" runat="server" Text="Copy" BackColor="#E49642" BorderColor="#CC7A24" ForeColor="White"
                                    CommandName="btnCopyClick" CommandArgument='<%# Eval("TestId") %>' />
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                        <EditRowStyle HorizontalAlign="Center" VerticalAlign="Middle" />
            <EmptyDataRowStyle HorizontalAlign="Center" VerticalAlign="Middle" />
         <FooterStyle BackColor="Tan" />
            <HeaderStyle BackColor="#CB6811" Font-Bold="True" ForeColor="White" HorizontalAlign="Center" />
            <PagerStyle BackColor="PaleGoldenrod" ForeColor="DarkSlateBlue" 
                HorizontalAlign="Center" />
            <RowStyle HorizontalAlign="Center" VerticalAlign="Middle" />
            <SelectedRowStyle BackColor="#E49642" ForeColor="GhostWhite" />
            <SortedAscendingCellStyle BackColor="#FAFAE7" />
            <SortedAscendingHeaderStyle BackColor="#DAC09E" />
            <SortedDescendingCellStyle BackColor="#E1DB9C" />
            <SortedDescendingHeaderStyle BackColor="#C2A47B" />
                </asp:GridView>
                        </td>
                    </tr>
            </table>
            </td>
        </tr>
    </table>
</asp:Content>

